package com.pep.mgmt.model.entity;

import java.time.LocalDateTime;

import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

import jakarta.persistence.Entity;
import jakarta.persistence.EntityListeners;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import lombok.Data;

@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
public class ConfigEntity {

    @Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
    @JsonIgnore
    private Long id;

    @CreatedDate
    @JsonIgnore
    private LocalDateTime creationTime;

    @LastModifiedDate
    @JsonIgnore
    private LocalDateTime lastModifiedDate;
    
    @JsonIgnore
    private boolean pendingConfigUpdate;

    @JsonProperty("TunnelTcpAlgo")
    private String tunnelTcpAlgo;   
    @JsonProperty("TunnelTcpHighWaterMark")
    private long tunnelTcpHighWaterMark;
    @JsonProperty("TunnelTcpLowWaterMark")
    private long tunnelTcpLowWaterMark;
    
    @JsonProperty("ClientTcpAlgo")
    private String clientTcpAlgo;
    @JsonProperty("ClientTcpHighWaterMark")
    private long clientTcpHighWaterMark;
    @JsonProperty("ClientTcpRecvBuffer")
    private long clientTcpRecvBuffer;

    public ConfigEntity() {
        pendingConfigUpdate = false;
    }
}
